package hvzt.minimap.ambassador;

import hvzt.minimap.activities.ServerActivity;
import hvzt.minimap.asynctasks.KillTask;
import hvzt.minimap.asynctasks.RegistrationTask;
import iface.Kill;
import iface.Registration;

/**
 * This singleton class is responsible for handling server calls for the Activities. 
 * @author Franklin Pearsall
 *
 */
public class Ambassador {
	
	private static Ambassador s_instance = null;
	
	public static Ambassador getInstance() {
		if (s_instance == null) {
			s_instance = new Ambassador();
		}
		return s_instance;
	}
	
	/**
	 * Send a kill message to the server using an async task.
	 * @param k
	 * @param s
	 */
	public void sendKill(Kill k, ServerActivity s) {
		new KillTask(s).execute(k);
	}
	
	/**
	 * Send a registration message to the server using an async task.
	 * @param r
	 * @param s
	 */
	public void sendRegistration(Registration r, ServerActivity s) {
		new RegistrationTask(s).execute(r);
	}
	
}
